home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / os2 / srefv12i.zip / perl.doc < prev    next >
Text File  |  1997-03-25  |  4KB  |  88 lines

  1.               SRE-Filter and the use of CGI-BIN scripts written in PERL.
  2.  
  3. By default, SRE-Filter assumes that a CGI-BIN script is written
  4. in REXX.  However, to take advantage of the wide-world of PERL scripts,
  5. SRE-Filter can invoke non-REXX interpreters when running a CGI-BIN script.
  6.  
  7. Basically, to do this you just set the SRE-Filter's INTERPRET_TYPES parameter.
  8. The details on how to do this are in INITFILT.DOC; for now, let's assume
  9. that we've set INTERPRET_TYPES=' PL=PERL5'. 
  10.  
  11. Given the above, let's consider some examples:
  12.   * If the request string is:  CGI-BIN/TEST-CGI?arg1
  13.     then SRE-Filter will CALL the TEST-CGI program, which should either
  14.     be a REXX program, or a binary executable (a .EXE file).
  15.  
  16.  * If the request string is: CGI-BIN/TXTCLOCK.PL
  17.     the SRE-Filter will invoke the PERL5 processor, and use it
  18.     to execute TXTCLOCK.PL.
  19.  
  20. So all you need to do is make sure your PERL scripts have a .PL extension.
  21. Oh, you also need to install an OS/2 version of PERL on your
  22. computer (in this case, one with a name of PERL5).  
  23. We've had some luck with the following.
  24.  
  25. 1) Obtain the PERL5 interpreter. You can get it at hobbes, look
  26. under /os2/unix/perl502.zip.
  27.  
  28.     Hobbes can be found via FTP at ftp-os2.nmsu.edu, or through the
  29.     web at http://hobbes.nmsu.edu
  30.  
  31. 2) You'll also need a copy of the EMX "runtime environment". You can
  32. get it at hobbes, under /os2/unix/emx09c/emxrt.zip
  33.  
  34. 3) Upon obtaining these two packages, you need to install them.
  35.    The following worked for us (though you probably will want
  36.    to look at the documentation that comes with both packages):
  37.  
  38.      a) * Create an \EMX directory somewhere (say, on C:).
  39.         * Copy EMXRX.ZIP to this directory and UNZIP it.
  40.         * Modify the following in  CONFIG.SYS:
  41.              i) Add C:\emx\dll to  you LIBPATH= line.
  42.              ii) Add c:\emx\bin to your PATH= line.
  43.           (of course, the c:\emx should be changed to reflect where
  44.            you installed EMX).
  45.      b)* Create a \PERL directory somewhere (say, on D:).
  46.          The PERL authors HIGHLY recommend using a HPFS drive;
  47.          since most PERL scripts are long-named. That means
  48.          you might have to change the location of your CGI_BIN_DIR
  49.          directory (or use SRE-Filter's virtual directories when calling 
  50.          PERL scripts).
  51.        * Copy perl502.zip to this directory, and UNZIP it.
  52.        * Copy PERL5.EXE and PERLGLOB.EXE to a directory in the
  53.          OS/2 PATH (i.e.; C:\OS2\APPS).
  54.        * Copy PERL5.DLL to a directory in the OS/2 LIBPATH
  55.          (i.e.; C:\OS2\DLL)
  56.        * Add the following to config.sys: 
  57.               SET PERL5LIB=D:\PERL5\LIB
  58.          (of course, D:\PERL should be changed to reflect where
  59.           you've installed PERL).
  60.        * The authors also suggest adding: 
  61.               SET PERL5LOAD=10 
  62.          (to leave the interpreter in memory, thereby reducing load time)
  63.  
  64.  
  65. 4)  You'll have to reboot for these changes to take effect.
  66.  
  67.  
  68. 5) Make sure that INTERPRET_TYPES=' PL=PERL5 ' (it's set in the
  69. INITFILT.80 file). By default, it will have that value, so you
  70. should only need to check it if you've been messin' around.
  71.  
  72.   
  73. That should do it.  You'll probably want a few scripts to try out --
  74. a good source is Matt's Script archive, located at:
  75.   http://worldwidemart.com/scripts
  76. As a convenience, a very simple "time" script (TXTCLOCK.PL) is
  77. included with SRE-Filter; we recommend calling it as a #EXEC include --
  78. just insert the following in an HTML document:
  79.      <!-- #EXEC cmd="txtclock.pl" -->
  80.  
  81.  
  82. Good luck.
  83.  
  84. (and thanks to David Richardson for pointing out the need, and for
  85. finding PERL502, etc.)
  86.  
  87.  
  88.